home *** CD-ROM | disk | FTP | other *** search
/ Super Shareware Collection / Super Shareware Collection.iso / os_2 / ls351o.zip / LSORTOS2.HLP < prev    next >
Text File  |  1994-02-05  |  11KB  |  237 lines

  1. LSORTOS2 3.51 (C) Copyright London Computing, 1983-1993.
  2. All rights reserved.
  3.  
  4. LSORTOS2 is a general purpose sort/merge utility written in IBM C++ for
  5. IBM OS2 2.0 and above.
  6.  
  7. LSORTOS2 is User Supported Software,  if this program proves useful, please
  8. make a contribution ($35 suggested) to:
  9.  
  10. London Computing, P.O. Box 696  Cherry Hill, NJ 08003
  11.  
  12. Anyone sending a contribution will receive a disk containing the source code
  13. to LSORTOS2 as well as a copy of the LSRT sort filter.  LSRT is similar to the
  14. DOS SORT filter but works much faster and will sort on multiple fields.
  15.  
  16. You may make copies of this software and distribute to other users as long as
  17. there is no charge or other consideration and this notice is not removed or
  18. bypassed.
  19.  
  20. LSORTOS2 will sort MSDOS, OS2 files and dBase II and dBase III
  21. databases.  (dBase III memo files and FOXPRO memo files are not sorted
  22. but .DBF files will be sorted.) Each file may be sorted using 1 to 32
  23. sort fields.  The file to be sorted may contain either fixed length
  24. records, variable length records or comma delimited records.  Variable
  25. length records are records ending with cr/lf.  Comma delimited records
  26. are variable length records where the fields are also variable length
  27. and separated by a comma.  Character fields may be enclosed in either
  28. single or double quotes.  It will merge up to 5 files using 1 to 32
  29. sort fields.  dBase databases may not be merged.  Any field may be
  30. sorted in either ascending or descending sequence.  LSORTOS2 allows for
  31. three user defined field types to be used: X,Y and Z.  You must write
  32. your own comparison subroutine to compare user defined fields.
  33.  
  34. The sort knows about:                       field type
  35.  
  36. binary fields (to 127 bytes)                      B
  37.    Binary Fields are sorted from left to right
  38.    one byte at a time based on the code in each
  39.    position (0-255).  Useful for comparing
  40.    IBM Mainframe style binary numbers.  
  41. packed decimal fields (1-8 bytes) Stored as on    P
  42.    IBM Mainframe computers.  Each digit position
  43.    is stored in 4 bits as a binary value between
  44.    0 and 10.  The digits are stored left to
  45.    right with the rightmost position containing
  46.    a sign, 0x0D for negative, 0x0C or 0x0F for
  47.    positive.  A packed decimal field can store
  48.    between 1 and 15 digits depending on the
  49.    length of the field.  If an invalid sign
  50.    field is specified, the sort won't produce
  51.    what you would expect.  Packed decimal values
  52.    are only meaningful in fixed length record.   
  53. character fields (to 127 bytes)                   C
  54.    Character fields compare up to the first
  55.    binary zero in the field, following the C
  56.    language conventions for character strings.
  57. upper case character fields (sort fields are      U
  58.    translated to upper case before compare)
  59. 2 byte integers in internal  format               I
  60. 4 byte integers in internal format                L
  61. floating point numbers (ieee)                     F
  62. double precision floating point (ieee)            D
  63. zoned decimal  numbers                            N
  64.    (Text format numbers,  Decimals are allowed)
  65.    (LSORTOS2 now supports scientific notation as)
  66.    (well, using E notation, eg. .98 == 9.8E-1)
  67.    (xBase N and F fields are sorted as type Z)
  68. 1 byte logical fields (dBase II or III)           T
  69. User defined field type X                         X
  70. User defined field type Y                         Y
  71. User defined field type Z                         Z
  72.  
  73. A zoned decimal number is stored as a character string and may contain
  74. leading and trailing spaces, minus sign, decimal point and digits.
  75.  
  76. NOTE: zoned decimal numbers and comma delimitted files sort very slowly!
  77. The only reasonable field types for comma delimited files are C or N. LSORT
  78. will accept other field types, but the results are undefined.
  79.  
  80.  
  81. LSORTOS2 will prompt you for all parameters and file names or you may specify
  82. some or all of the parameters on the command line when you invoke the sort.
  83.  
  84. The maximum record length is 4096 bytes.  Files will be sorted in memory if
  85. possible.
  86.  
  87. Files larger than available memory are sorted in pieces and then merged
  88. together.  If you have a floppy only system, you should have LSORTOS2 on the A
  89. drive and the file to be sorted on the B drive.  Place a copy of LSORTOS2 on an
  90. otherwise empty disk and use as your A drive.  You may need a formatted empty
  91. disk for work files on the B drive.
  92.  
  93.  
  94. SYNTAX:
  95.  
  96.  
  97. LSORTOS2 [-h | -m] -- will prompt you for all necessary information.
  98.  or
  99. LSORTOS2 [-h | -m] sort specifications--will take the specification
  100.                 specified and prompt you for any others.
  101.  
  102. Specify -h if you are using a fixed (hard disk) for your output and
  103. merge files.  This will eliminate mount messages.  This is the default
  104. for LSORTOS2 3.01 and above.  Specify -m if you are using mountable disks
  105. (floppy, Bournouli, etc.).  This allows you to mount disks to contain
  106. work files and output files.
  107.  
  108.  or
  109.  
  110. LSORTOS2 -R  -- will restart a sort.
  111.  
  112.  
  113. Sort Specifications:
  114.  
  115. You will be asked to specify either a SORT or MERGE operation.
  116.  
  117. If you ask for a SORT, you may tell LSORTOS2 to use either a QUICKSORT or
  118. HEAPSORT for internal sorting.  You will also be asked to specify two
  119. devices to hold merge files if any are needed.  Merge files may be placed on
  120. floppy disk, hard disk or RAM disk.  The specified drive must be large
  121. enough to hold the entire input file.  You will be given the opportunity to
  122. change floppy disks if desired before each merge drive is used and before
  123. the output file is written.  The program will wait for you to press 'Y'
  124. before proceeding.  This is not really a problem for unattended sorting
  125. if you use redirected input or specify all prompts on the command line.
  126.  
  127. If you specify SORT or MERGE you will be prompted for your input file(s) and
  128. output file as well as the definition of the key fields to be used in the
  129. comparisons.  Fields are specified by their starting position and length.
  130. The types of fields have been listed above.
  131.  
  132. The sort specifications may be entered on the command line in the order
  133. requested by LSORT. Each parameter should be separated from the others with
  134. one or more spaces.  You will not be prompted for any specification on the
  135. command line (including requests to change disks).
  136.  
  137. The sort will ask for the following information in the order shown:
  138.  
  139. Type of Sort:  You may reply:
  140. S -- for QUICKSORT
  141. H -- for HEAPSORT
  142.  
  143. Merge Drive 1:  You may reply with any drive letter, although it is best to
  144. specify a fixed disk (if any).
  145.  
  146.  
  147. Merge Drive 2:  This should be different from drive 1 if you are using
  148. floppy disks, but should be a fixed disk if you have one.
  149.  
  150. Name of input file: You may specify any name including drive letter and
  151. path.  Specify :X to use a user specified input routine.
  152.  
  153. Name of output file:  See above.  Specify :X to use a user specified output
  154. routine.
  155.  
  156. File Type (Unless you are sorting a dBase file):  You may reply F for a
  157. fixed length file (all records are the same length), V for a varying
  158. length file (records must end with CR LF.) or D for comma delimited files.
  159.  
  160.  
  161. If you entered 'F' for a fixed file, you will be prompted for the record
  162. length.
  163.  
  164. You will then be prompted for field definitions.  Each field definition has
  165. four parts:    starting position (from 1)  or  starting field (delimited files)
  166.                field length (in bytes)         (no prompt for delimited files)
  167.                field type (See above list of valid types)
  168.                sort order (A--Ascending, D--Descending)
  169.  
  170. In order to work as efficiently as possible, LSORTOS2 does not check the
  171. starting position of a field against the actual length of a record.  If some
  172. field starts past the end of a record (e.g. sort field 1 starts in column 10
  173. but the record is only 8 bytes long), the results will be undefined and most
  174. certainly not what you want.  Please be careful.
  175.  
  176. Enter a '0' for the starting position to end the prompt for field
  177. definitions.
  178.  
  179. If you are sorting a dBase file, you will see a list of fields.  You may
  180. specify a field by name, in which case you will only be prompted for the
  181. sort order or you may enter starting position, length, type and order as
  182. above.
  183.  
  184. Following the '0' that ends field definitions, you may specify a series of
  185. 'Y's if you know that the disks currently mounted will hold merge work files
  186. and the output file.  These may be omitted if you specified the -H flag.
  187.  
  188. example 1:
  189.  
  190. Sort file test.dat on positions 1-5,char,ascending and 6-7, binary integer,
  191. descending.  Use drive C for the work files and put the sorted file in
  192. test.srt.
  193.  
  194. Issue the following command:
  195.  
  196. LSORTOS2 S C C test.dat test.srt V 1 5 C A 6 2 H D 0 Y Y Y
  197.          | | | |        |        | |_____| |_____| | | | |
  198.          | | | input    output   F |       |       | | | response to mount
  199.          | | | file     file     i sort    sort    | | | output file message.
  200.          | | | name     name     l field 1 field 2 | | |
  201.          | | |                   e starts  starts  | | response to mount 2nd
  202.          | | merge drive 2         at byte at byte | | merge volume message.
  203.          | |                     T 1, is 5 6, is 2 | |
  204.          | merge drive 1         y byte    byte    | response to mount first
  205.          |                       p char-   long    | merge volume message.
  206.          sort using              e acter   integer |
  207.          quicksort                 string  sorted  ends list of sort fields.
  208.                                    ascend- descend-
  209.                                    ing     ing
  210.  
  211.  
  212.  
  213. Merge Specification:
  214.  
  215. Enter 'M' to indicate the merge operation.
  216.  
  217. You will be asked to enter the number of files to be merged followed by 1-5
  218. files to be merged. They are entered one at a time.
  219.  
  220. You will be asked to enter a file type, output file and a field list as
  221. above.
  222.  
  223. example:
  224.  
  225. Merge files t1.dat t2.dat and t3.dat on positions 4-7 defined as a character
  226. field, ascending.
  227.  
  228. LSORTOS2 M 3 t1.dat t2.dat t3.dat   test.mrg V 4 4 c a 0 y y
  229.          | | |      |      |        |        | |_____| | |_|
  230.          | | input  input  input    output   | |       | |
  231.          | | file 1 file 2 file 3   file     | merge   | response to mount
  232.          | |                                 | field   | messages
  233.          | merge 3 files                     | 1       |
  234.          |                                   |         end of list of merge
  235.          do a merge                          file      fields
  236.                                              type
  237.